package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import cp.solution.util.time.DateKit;
import cp.solution.util.str.Str;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@NoteClass("跨服boss")
public class GDCrossBoss {

	public static final long WHOLE_DAY_MILLIS = 24 * 3600 * 1000L;

	@NoteField("分享间隔")
	public static final long SHARE_INTERVAL_TIME = 10 * 1000L;

	@NoteField("刷新间隔")
	public static final long REFRESH_INTERVAL_TIME = 10 * 1000L;

	@NoteField("挑战间隔")
	public static final long CHALLENGE_INTERVAL_TIME = 10 * 1000L;

	@NoteField("星期几开")
	public static List<Integer> OPEN_DAYS = new ArrayList<>();

	@NoteField("活动开始时间")
	public static String START_TIME_STR;

	@NoteField("活动结束时间")
	public static String END_TIME_STR;

	@NoteField("停止接取任务时间")
	public static String STOP_TAKE_TASK_TIME_STR;

	@NoteField("清理活动数据时间")
	public static final String CLEAR_DATA_TIME_STR = "23:55:00";

	@NoteField("任务持续时间")
	public static long TASK_TIME;

	@NoteField("离队惩罚时间")
	public static long QUIT_PUNISH_TIME;

	@NoteField("属性强化系数")
	public static double ATTR_ENHANCE_COEFF;

	@NoteField("每日队长奖励次数")
	public static int DAILY_LEADER_RWD_TIME;

	@NoteField("每日击杀奖励次数")
	public static int DAILY_KILL_TIME;

	@NoteField("roll点等待时间")
	public static long ROLL_WAIT_TIME;

	@NoteField("最大成员数")
	public static final int TEAM_MEMBER_MAX = 3;

	@NoteField("队伍录像最大条数")
	public static final int TEAM_REPLAY_MAX = 10;

	@NoteField("队伍日志最大条数")
	public static final int TEAM_LOG_MAX = 30;

	@NoteField("队伍聊天记录最大条数")
	public static final int CHAT_ITEM_MAX = 10;

	@NoteField("roll点范围")
	public static final List<Integer> ROLL_POINTS = new ArrayList<>();


	@NoteClass("职位")
	public static class Pos{

		@NoteField("队长")
		public static final byte LEADER = 1;

		@NoteField("成员")
		public static final byte MEMBER = 2;
	}

	@NoteClass("出战顺序")
	public static class Order {

		public static final int ORDER_1 = 1;

		public static final int ORDER_2 = 2;

		public static final int ORDER_3 = 3;

		public static final List<Integer> ALL_ORDERS = Arrays.asList(ORDER_1,ORDER_2,ORDER_3);
	}


	@NoteClass("roll点日志类型")
	public static class RollLogType {
		@NoteField("参与roll点")
		public static final byte ROLL = 1;
		@NoteField("放弃roll点")
		public static final byte GIVE_UP = 2;
		@NoteField("获得奖励")
		public static final byte GET_RWD = 3;
		@NoteField("没有资格")
		public static final byte NO_QUALITIED = 4;
	}

	static {
		for (int i = 1; i <= 100; i++) {
			ROLL_POINTS.add(i);
		}
	}

	@NoteClass("组队日志")
	public static class LogId{
		//[队长]{s0}创建了队伍。
		public static final int CREATE_TEAM = 751012;
		//[队长]{s0}发布了招募。
		public static final int PUBLISH_RECRUIT = 751013;
		//[队长]{s0}修改了招募。
		public static final int UPDATE_RECRUIT = 751014;
		//[队长]{s0}发送了广告。
		public static final int LEADER_SHARE_RECRUIT = 751015;
		//[队员]{s0}发送了广告。
		public static final int MEMBER_SHARE_RECRUIT = 751016;
		//[队员]{s0}进入了队伍。
		public static final int MEMBER_ENTER_TEAM = 751017;
		//[队员]{s0}离开了队伍。
		public static final int MEMBER_QUIT_TEAM = 751018;
		//[队长]{s0}调整了队伍顺序。
		public static final int CHANGE_ORDER = 751019;
		//[队长]{s0}将[队员]{s1}踢出了队伍。
		public static final int KICK_MEMBER = 751020;
		//[队长]{s0}调整了自己的阵容。
		public static final int LEADER_CHANGE_PS = 751021;
		//[队员]{s0}调整了自己的阵容。
		public static final int MEMBER_CHANGE_PS = 751022;
		//[队长]{s0}开启了{s1}的讨伐。
		public static final int TAKE_TASK = 751023;
		//讨伐{s0}成功。
		public static final int FIGHT_SUCCESS = 751024;
		//讨伐{s0}失败。
		public static final int FIGHT_FAIL = 751025;
        //[队长]{s0}将队伍转让给[队员]{s1}。
		public static final int TRANSFER_LEADER = 751026;
		//[队长]{s0}将{s1}降低至{s2}。
		public static final int CHANGE_BOSS = 751027;
	}


	public static void initialize(ParamSheet paramSheet) {
		String openDayStr = GDParamTool.getString(paramSheet, 170001, "1#2#3#4#5#6#7");
		OPEN_DAYS = Str.strArr2intList(openDayStr.split("#"));
		START_TIME_STR = GDParamTool.getString(paramSheet, 170002, "07:00:00");
		END_TIME_STR = GDParamTool.getString(paramSheet, 170003, "23:00:00");
		STOP_TAKE_TASK_TIME_STR = GDParamTool.getString(paramSheet, 170004, "22:30:00");
		TASK_TIME = GDParamTool.getLong(paramSheet, 170005, 120L) * DateKit.MINUTE_MS;
		QUIT_PUNISH_TIME = GDParamTool.getLong(paramSheet, 170006, 10L) * DateKit.SECOND_MS;
		ATTR_ENHANCE_COEFF = GDParamTool.getDouble(paramSheet, 170007, 10d);
		DAILY_LEADER_RWD_TIME = GDParamTool.getInt(paramSheet, 170008, 2);
		DAILY_KILL_TIME = GDParamTool.getInt(paramSheet, 17009, 6);
		ROLL_WAIT_TIME = GDParamTool.getLong(paramSheet, 17010, 30L) * 1000L;
	}
}
